package com.zf.bytecode;

/**
 * 字节码：https://www.dazhuanlan.com/susei0714/topics/1238105
 * javap -c TestByteCode.class
 * @author Zhou Feng
 */
public class TestByteCode extends TestVolatile{

    public static int age;

    public static boolean ok = false;

    public TestByteCode() {
        age = 1;
    }

    public static void main(String[] args) {
        boolean a = true; // 编译成字节码后 是 int 类型
        if(a){
            System.out.println("吃了");
        }
        if(a==true){
            System.out.println("真吃了");
        }

        new TestByteCode().getTest();

        int b =2;
        if (b>=1){
            System.out.println("bb");
        }

        Integer c = null;
        if (c==null){
            System.out.println("null-text");
        }

        System.out.println(b++);
        System.out.println(++b);

        b = b+1;


        int x = 1;
        int y = x++ + ++x;
        System.out.println(y);// 4

        age = 21;

        System.out.println(Integer.MAX_VALUE);
    }

    public void getTest(){
        int[] ints = new int[2];
        int d =-2;
        ints[0]= d;
        long x = ints[0];
        d = ints[0];
        System.out.println(d);
        float y = 2.0f;
        System.out.println(y);
        System.out.println(ints.length);
    }

    public String testFor(){
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < 3; i++) {
            builder.append(i);
        }
        return builder.toString();
    }
}
